﻿CREATE TABLE [dbo].[tblCustomerSourceID] (
    [CustomerSourceID] INT          IDENTITY (1, 1) NOT NULL,
    [CustomerID]       INT          NOT NULL,
    [IDSourceCode]     CHAR (1)     NULL,
    [OwnerID]          INT          NOT NULL,
    [IDValue]          VARCHAR (20) NOT NULL,
    PRIMARY KEY CLUSTERED ([CustomerSourceID] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF),
    FOREIGN KEY ([IDSourceCode], [OwnerID]) REFERENCES [dbo].[codeIDSource] ([IDSourceCode], [OwnerID]) ON DELETE NO ACTION ON UPDATE NO ACTION
);

